package net.kehk.towerdefense.gamelogic;

import java.util.ArrayList;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.maps.tiled.TiledMap;

public class World {
	TiledMap map;
	ArrayList<DrawableEntity> drawable_entities;
	ArrayList<Projectile> projectiles;

	public World(){
		this.drawable_entities=new ArrayList<DrawableEntity>();
	}

	public void addDrawableEntity(DrawableEntity d){
		this.drawable_entities.add(d);
	}

	public void removeDrawableEntity(int index){
		this.drawable_entities.remove(index);
	}

	public void update(){
		for(DrawableEntity e : drawable_entities){
			if(e.getDeleteFlag()) drawable_entities.remove(e);
		}
	}

	public void render(SpriteBatch sb){
		for(DrawableEntity e : drawable_entities){
			e.render(sb);
		}
	}
}